<app-content-header
  [search]="search"
>
  <ng-template #search>
    <app-search [(data)]="searchSchema" (bindSearch)="handleSearch()"></app-search>
  </ng-template>
</app-content-header>

<div class="cil-table-block">
  <st
    #st
    [scroll]="scroll"
    [data]="data"
    [columns]="columns"
    [ps]="ps"
    [pi]="pi"
    [page]="stPage"
    [total]="total"
    [loading]="loading"
    (change)="onChange($event)"
  >
    <ng-template st-row="auditType" let-item>
      <span>{{ getAuditTypeValue(item.auditType) }}</span>
    </ng-template>

    <ng-template st-row="status" let-item>
      <span>{{ getAuditStatus(item) }}</span>
    </ng-template>
  </st>
</div>

<ng-template #tplAcquirer>
  <app-aams-select
    level="institution"
    [(ngModel)]="selectedAcquirer"
    [disabled]="isAcquirerUser"
  ></app-aams-select>
</ng-template>

<ng-template #tplGroup>
  <app-aams-select
    level="agent"
    [(ngModel)]="selectedGroup"
    [insCode]="selectedAcquirer ? selectedAcquirer.code : ''"
    [disabled]="isAgentUser"
  ></app-aams-select>
</ng-template>

<ng-template #tplMerchant>
  <app-aams-select
    level="merchant"
    [(ngModel)]="selectedMerchant"
    [insCode]="selectedAcquirer ? selectedAcquirer.code : ''"
    [agentCode]="selectedGroup ? selectedGroup.code : ''"
    [disabled]="isMerchantUser"
  ></app-aams-select>
</ng-template>

<ng-template #tplStore>
  <app-aams-select
    level="store"
    [(ngModel)]="selectedStore"
    [insCode]="selectedAcquirer ? selectedAcquirer.code : ''"
    [agentCode]="selectedGroup ? selectedGroup.code : ''"
    [intMerCode]="selectedMerchant ? selectedMerchant.code : ''"
    [disabled]="isStoreUser"
  ></app-aams-select>
</ng-template>

<!-- 之后会用到 用Modal来pop up一个新的页面
<nz-modal
  [(nzVisible)]="isVisible"
  [nzTitle]="modalTitle"
  [nzContent]="modalContent"
  [nzFooter]="modalFooter"
  (nzOnCancel)="handleModalCancel()"
>
  <ng-template #modalTitle>
    Custom Modal Title
  </ng-template>

  <ng-template #modalContent>
    <p>Modal Content</p>
    <p>Modal Content</p>
    <p>Modal Content</p>
    <p>Modal Content</p>
    <p>Modal Content</p>
  </ng-template>

  <ng-template #modalFooter>
    <button nz-button nzType="default" (click)="handleModalCancel()">撤回</button>
    <button nz-button nzType="default" (click)="handleModalCancel()">拒绝</button>
    <button nz-button nzType="primary" (click)="click()">通过</button>
  </ng-template>
</nz-modal> -->
